
package com.lee.logger; 
 
import java.time.LocalDateTime; 
import java.time.format.DateTimeFormatter; 
 
public class Logger { 
    private static String level = "info";
    public static void info(String info){
        System.out.println("Thread " + Thread.currentThread().getId() + " INFO "+ DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss SSS").format(LocalDateTime.now()) + " => " + info);
    }
    public static void error(String message){
        System.out.println("Thread " + Thread.currentThread().getId() +" Error "+ LocalDateTime.now().toString() + " => " + message);
    }
    public static void error(String message,Exception e){
        System.out.println("Thread " + Thread.currentThread().getId() +" Error "+ LocalDateTime.now().toString() + " => " + message);
        System.out.println(e);
    }
 
    public static  void info(Object ...message){
        System.out.print("Thread " + Thread.currentThread().getId() +" INFO " + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss SSS").format(LocalDateTime.now()) + " => ");
        for(Object msg:message){
            System.out.print(msg);
            System.out.print(" ");
        }
        System.out.println();
    }
    public static void debug(Object ...message){
        if(level != "debug"){
            return ;
        }
        System.out.print("Thread " + Thread.currentThread().getId() +" DEBUG " + LocalDateTime.now().toString() + " => ");
        for(Object msg:message){
            System.out.print(msg);
            System.out.print(" ");
        }
        System.out.println();
    }
 
    public static  void error(Object ...message){
        System.out.print("Thread " + Thread.currentThread().getId() +" ERROR " + LocalDateTime.now().toString() + " => ");
        for(Object msg:message){
            System.out.print(msg);
            System.out.print(" ");
        }
        System.out.println();
    }
} 
